package com.weixin.paleituo.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 提现金额、账户、类型bean
 *
 * @author fengzhen
 * @version v1.0, 2018/5/14
 */
public class WithdrawAccountBean implements Parcelable{


    /**
     * alipay : {"id":2,"payeeAccount":"18512836203","payeeRealName":"冯真","paymentMethod":1,"phone":"18380460807","updateTime":"2018-05-14 14:44:10","balance":null}
     * balance : 99.99
     * wechat : null
     */

    private AlipayBean alipay;
    private double balance;
    private Object wechat;

    protected WithdrawAccountBean(Parcel in) {
        alipay = in.readParcelable(AlipayBean.class.getClassLoader());
        balance = in.readDouble();
    }

    public static final Creator<WithdrawAccountBean> CREATOR = new Creator<WithdrawAccountBean>() {
        @Override
        public WithdrawAccountBean createFromParcel(Parcel in) {
            return new WithdrawAccountBean(in);
        }

        @Override
        public WithdrawAccountBean[] newArray(int size) {
            return new WithdrawAccountBean[size];
        }
    };

    public AlipayBean getAlipay() {
        return alipay;
    }

    public void setAlipay(AlipayBean alipay) {
        this.alipay = alipay;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public Object getWechat() {
        return wechat;
    }

    public void setWechat(Object wechat) {
        this.wechat = wechat;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(alipay, flags);
        dest.writeDouble(balance);
    }

    public static class AlipayBean implements Parcelable{
        /**
         * id : 2
         * payeeAccount : 18512836203
         * payeeRealName : 冯真
         * paymentMethod : 1
         * phone : 18380460807
         * updateTime : 2018-05-14 14:44:10
         * balance : null
         */

        private int id;
        private String payeeAccount;
        private String payeeRealName;
        private int paymentMethod;
        private String phone;
        private String updateTime;
        private Object balance;

        protected AlipayBean(Parcel in) {
            id = in.readInt();
            payeeAccount = in.readString();
            payeeRealName = in.readString();
            paymentMethod = in.readInt();
            phone = in.readString();
            updateTime = in.readString();
        }

        public static final Creator<AlipayBean> CREATOR = new Creator<AlipayBean>() {
            @Override
            public AlipayBean createFromParcel(Parcel in) {
                return new AlipayBean(in);
            }

            @Override
            public AlipayBean[] newArray(int size) {
                return new AlipayBean[size];
            }
        };

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getPayeeAccount() {
            return payeeAccount;
        }

        public void setPayeeAccount(String payeeAccount) {
            this.payeeAccount = payeeAccount;
        }

        public String getPayeeRealName() {
            return payeeRealName;
        }

        public void setPayeeRealName(String payeeRealName) {
            this.payeeRealName = payeeRealName;
        }

        public int getPaymentMethod() {
            return paymentMethod;
        }

        public void setPaymentMethod(int paymentMethod) {
            this.paymentMethod = paymentMethod;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getUpdateTime() {
            return updateTime;
        }

        public void setUpdateTime(String updateTime) {
            this.updateTime = updateTime;
        }

        public Object getBalance() {
            return balance;
        }

        public void setBalance(Object balance) {
            this.balance = balance;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(id);
            dest.writeString(payeeAccount);
            dest.writeString(payeeRealName);
            dest.writeInt(paymentMethod);
            dest.writeString(phone);
            dest.writeString(updateTime);
        }
    }
}
